package com.douxg.learning.bigdata.kafka;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/")
public class KafkaController {
    @Resource
    private KafkaProducer kafkaProducer;

    @GetMapping("/")
    public String index(@RequestParam String msg) {
        kafkaProducer.sendLog(msg);
        return msg;
    }
}
